<?php $this->load->view('base/header'); ?>

<link rel="stylesheet" media="screen" href="<?php echo base_url() . 'css/jquery.datatable.gui.css' ?>"/>

<link rel="stylesheet" media="screen" href="<?php echo base_url() . 'css/jquery-ui-1.8.14.custom.css' ?>"/>
<link rel="stylesheet" media="screen" href="<?php echo base_url() . 'css/table.css' ?>"/>

<script type="text/javascript" src="<?php echo base_url() . 'js/jquery-ui-1.8.14.custom.min.js' ?>"></script>
<script type="text/javascript" src="<?php echo base_url() . 'js/jquery.dataTables.js' ?>"></script>
<script type="text/javascript" src="<?php echo base_url() . 'js/br-03/app_peminjaman.js' ?>"></script>
<script type="text/javascript" src="<?php echo base_url() . 'js/br-03/bukti_transaksi.js' ?>"></script>
<script type="text/javascript" src="<?php echo base_url() . 'js/jquery.formatCurrency-1.4.0.js' ?>"></script>


<section>
    <div class="container_8 clearfix">
        <section class="main-section grid_8">
            <div class="main-content">
                <header>
                    <ul class="action-buttons clearfix fr">
                    </ul>
                    <h2>Persetujuan Layanan</h2>
                </header>
                <section class="container_6 clearfix">
                    <div class="grid_6">
                        <section class="clearfix">
                            <form class="form" id="FORM_PINJAMAN" method="post">
                                <input type="hidden" id="ID_PINJAMAN" value="<?php echo $Pinjam->ID_PINJAMAN?>"/>
                                <div style="float: left;">
                                    <div class="clearfix">
                                        <label>ID Anggota<small></small></label>
                                        <input type="text" name="ID_ANGGOTA" id="ID_ANGGOTA" size="4"  readonly value="<?php echo $Pinjam->ID_ANGGOTA?>"/>
                                    </div>
                                    <div class="clearfix">
                                        <label>Nama<small></small></label>
                                        <input type="text" name="NAMA_ANGGOTA" id="NAMA_ANGGOTA"  readonly value="<?php echo $Pinjam->NAMA_ANGGOTA?>"/>
                                    </div>
                                </div>
                                <div style="float: left;">
                                    <div class="clearfix">
                                        <label>Devisi <small></small></label>
                                        <input type="text" name="NAMA_DIVISI" id="NAMA_DIVISI"  readonly value="<?php echo $Pinjam->NAMA_DIVISI?>"/>
                                    </div>
                                    <div class="clearfix">
                                        <label>Alamat <small> rumah</small></label>
                                        <input type="text" name="ALAMAT" id="ALAMAT"  readonly value="<?php echo $Pinjam->ALAMAT?>"/>
                                    </div>
                                </div>
                                <dir style="clear: both"></dir>
                                <hr/>

                                <input type="hidden" name="ID_PINJAMAN" value="<?php echo $Pinjam->ID_PINJAMAN?>"/>
                                <input type="hidden" name="BUNGA" value="<?php echo $Pinjam->BUNGA?>"/>
                                
                                <div style="float: left;">
                                    <div class="clearfix">
                                        <label>Jumlah Pinjaman<small><label id="RULE_PIUTANG"></label></small></label>
                                        <input type="text" name="MAX_PIUTANG" id="MAX_PIUTANG" maxlength="12" value="<?php echo $Pinjam->JUMLAH_PINJAMAN?>" class="currency"/>
                                    </div>
                                    <div class="clearfix">
                                        <label>Jangka Waktu<small><label id="RULE_CICIL"></label></small></label>
                                        <input type="text" name="MAX_CICIL" id="MAX_CICIL" maxlength="2" size="2"  value="<?php echo $Pinjam->LAMA_PINJAMAN?>"/>
                                    </div>
                                    <div class="clearfix">
                                        <label>Jenis Layanan<small></small></label>
                                        <select id="KODE_USAHA" name="KODE_USAHA">
                                            <?php foreach($Usaha->result() as $row):?>
                                            <?php if($Pinjam->ID_INFO_USAHA == $row->KODE_USAHA):?>
                                                <option selected value="<?php echo $row->KODE_USAHA?>"><?php echo $row->URAIAN_USAHA?></option>
                                            <?php else:?>
                                                <option value="<?php echo $row->KODE_USAHA?>"><?php echo $row->URAIAN_USAHA?></option>
                                            <?php endif;?>
                                            <?php endforeach;?>
                                        </select>
                                    </div>
                                    <?php if($Pinjam->ID_INFO_USAHA >0):?>
                                    <div class="clearfix">
                                        <label>Margin<small></small></label>
                                        <input type="text" name="MARGIN" class="currency" value="<?php echo $Pinjam->MARGIN * $Pinjam->LAMA_PINJAMAN?>"/>
                                    </div>
                                    <?php endif;?>
                                </div>

                                <div style="float: left;">

                                    <div class="clearfix">
                                        <label>Tanggal Pinjaman<small>yyyy-mm-dd</small></label>
                                        <input type="text"  name="TANGGAL_PINJAM" value="<?php echo $Pinjam->TGL_PINJAMAN?>"/>
                                    </div>
                                    <div class="clearfix">
                                        <label>Keterangan<small></small></label>
                                        <textarea name="KETERANGAN"><?php echo $Pinjam->KETERANGAN?></textarea>
                                    </div>
                                </div>
                                <div style="clear: both;"></div>

                                <div id="SKEMA_ANGSURAN"style="margin: 20px 0 0 0;">
                                    <h3>Skema Angsuran</h3>
                                    <table id="angsuran_table" style="width:90%;" class="detail_table">
                                        <thead>
                                            <tr>
                                                <td>Kewajiban Ke</td>
                                                <td>Cicilan Pokok</td>
                                                <td>Margin</td>
                                                <td>Kewajiban / Bulan</td>
                                                <td>Sisa Kewajiban</td>
                                            </tr>
                                        </thead>
                                        <tbody>

                                        </tbody>
                                        <tfoot>

                                        </tfoot>
                                    </table>
                                </div>
                                <div class="action clearfix" style="margin-top: 30px;">
                                    <button class="button button-gray" type="submit" id="CHANGE"><span class="pencil"></span>Ubah</button>
                                    <button class="button button-gray" type="submit" id="YES"><span class="accept"></span>Terima</button>
                                    <button class="button button-gray" type="submit" id="NO"><span class="bin"></span>Tolak</button>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <button class="button button-gray" type="submit" id="CETAK_KONSUL"><span class="view-list"></span>Cetak Konsultasi</button>
                                    <button class="button button-gray" type="submit" id="CETAK_PERJANJIAN"><span class="view-list"></span>Cetak Perjanjian</button>
                                </div>
                            </form>
                        </section>
                    </div>
                </section>
            </div>
    </div>

    <div id="app_dialog">
        <form class="form" id="SELECT_BUKTI" method="post">
            <div class="clearfix">
                <label>ID BKK/BKB<small></small></label>
                <input type="text" name="BKK_BKB" id="BKK_BKB" maxlength="20"  readonly/>
            </div>
            <div class="clearfix">
                <label>Nomer BKK/BKB<small></small></label>
                <input type="text" name="NOMER_BKK_BKB" id="NOMER_BKK_BKB" maxlength="20"  readonly/>
            </div>
            <div class="action clearfix" style="margin-top: 30px;">
                <button class="button button-gray" type="submit" id="SUBMIT"><span class="accept"></span>Simpan</button>
                <button class="button button-gray" type="reset"><span class="bin"></span>Batal</button>
            </div>
        </form>
    </div>

    <div id="bkk_bkb_dialog">
        <table id="bkk_bkb_table" width="100%" class="datatable">
            <thead>
            </thead>
            <tbody>
            </tbody>
        </table>
    </div>

</section>
<?php $this->load->view('base/footer'); ?>
